﻿using Blog.Core.Domain.Model.User;
using Blog.Core.DTO;
using Blog.Core.DTO.ViewModel;
using Blog.Core.DTO.ViewModel.User;
using Blog.Core.IRepositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;

namespace Blog.Core.IServices.IUser
{
    /// <summary>
    /// 用户信息服务接口
    /// </summary>
    public interface IUserService:IBaseService<UserInfo>
    {
        /// <summary>
        /// 用于获取用户已授权的功能列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        //List<Permissions> GetFunctionsByUserId(int Userid);
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<UserInfo>> UserLogin(PostUserLoginDTO dto);
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<int>> PostUserInfo(RequestUserDTO entity);
        /// <summary>
        /// 用户密码修改（用户本人修改）
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<int>> PutUserPwd(UserInfo entity);
        /// <summary>
        /// 用户列表
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        Task<PageDTO<GetUserInfoDTO>> GetUserInfo(int pageindex, int pagesize);
        /// <summary>
        /// 用户信息修改（用户本人修改）
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<int>> PutUserInfo(UserInfo entity);
        /// <summary>
        /// 获取用户单条信息（用于用户编辑个人信息使用）
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<GetUserInfoDTO> GetUserInfoById(int id);
        /// <summary>
        /// 删除（管理员删除(删除用户））
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<int>> DeleteUserInfo(int id);
        /// <summary>
        /// 删除（个人进行删除（账号注销））
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<int>> DeleteUserInfos(GetUserDeleteDTO dto);
        /// <summary>
        /// 用户修改（管理员进行修改）
        /// </summary>
        /// <param name="enity"></param>
        /// <returns></returns>
        Task<ResponseResultDTO<int>> PutUserInfos(RoleUserDTO dto);
        /// <summary>
        /// 刷新令牌需要的生成密码
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<RequestUserDTO> GetUserByNameAndPwd(PostUserLoginDTO dto);
        /// <summary>
        /// 获取用户的权限
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<MenuTreeDto>> GetFunctionsByUserId(string UserName);
        /// <summary>
        /// 权限过滤器获取用户所对应的权限
        /// </summary>
        /// <param name="UserId"></param>
        /// <returns></returns>
        Task<List<Permissions>> GetUserPermissions(int UserId);
    }
}
